package Yijun;

class Cat {
    private String name;

    public Cat(String name) {
        this.name = name;
    }

    public void mew() {
        System.out.println(name + "喵喵叫");
    }

    public void catchMouse(Mouse mouse) {
        mew();
        mouse.squeak();
        System.out.println(name + "最后抓住了" + mouse.getName());

    }

    public String getName() {
        return name;
    }
}
